import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SWuXingDice } from "../../../../../Message/Public/SWuXingDice";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class WuXingDiceUpdateCommand
    
    export  class WuXingDiceUpdateCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc3=null;
            var loc4=0;
            super.call(arg1);
            var loc1=arg1.messageBase as SWuXingDice;
            var loc2=_cache.role.wuxingInfo;
            if (loc2) 
            {
                if (loc3 = loc2.wxDice) 
                {
                    loc4 = loc3.wuxingValue;
                }
            }
            _cache.role.updateWuXingDice(loc1);
            if (loc1.wuxingValue == -1) 
            {
                _cache.role.updateJuHunValue(loc4);
                loc1.wuxingValue = loc4;
            }
            NetDispatcher.dispatchCmd(ServerCommand.WuXingDiceUpdateCommand, loc1);
            return;
        }
    }
